package co.edu.unal.bioingenium.kbmed.knowledge.vo;

/**
 *
 * @author Alejandro Riveros Cruz
 */
public class DescriptorData implements Comparable<DescriptorData> {

    private String conceptId;
    private String descriptorId;
    private String category;
    private String term;
    private short descriptorTokens;
    private double score;

    /**
     * 
     */
    public DescriptorData() {
    }

    /**
     * 
     * @param conceptId
     * @param descriptorId
     * @param category
     * @param descriptorTokens
     */
    public DescriptorData(String conceptId, String descriptorId, String category, short descriptorTokens) {
        this.conceptId = conceptId;
        this.descriptorId = descriptorId;
        this.category = category;
        this.descriptorTokens = descriptorTokens;
    }

    /**
     * 
     * @param conceptId
     * @param descriptorId
     * @param term
     * @param category
     * @param descriptorTokens
     */
    public DescriptorData(String conceptId, String descriptorId, String term, String category, short descriptorTokens) {
        this.conceptId = conceptId;
        this.descriptorId = descriptorId;
        this.term = term;
        this.category = category;
        this.descriptorTokens = descriptorTokens;
    }

    /**
     * 
     * @return
     */
    public String getCategory() {
        return category;
    }

    /**
     * 
     * @return
     */
    public String getConceptId() {
        return conceptId;
    }

    /**
     * 
     * @return
     */
    public short getDescriptorTokens() {
        return descriptorTokens;
    }

    /**
     * 
     * @return
     */
    public String getDescriptorId() {
        return descriptorId;
    }

    /**
     * 
     * @return
     */
    public String getTerm() {
        return term;
    }

    /**
     * 
     * @return
     */
    public double getScore() {
        return score;
    }

    /**
     * 
     * @param category
     */
    public void setCategory(String category) {
        this.category = category;
    }

    /**
     * 
     * @param conceptId
     */
    public void setConceptId(String conceptId) {
        this.conceptId = conceptId;
    }

    /**
     * 
     * @param descriptorId
     */
    public void setDescriptorId(String descriptorId) {
        this.descriptorId = descriptorId;
    }

    /**
     * 
     * @param descriptorTokens
     */
    public void setDescriptorTokens(short descriptorTokens) {
        this.descriptorTokens = descriptorTokens;
    }

    /**
     * 
     * @param term
     */
    public void setTerm(String term) {
        this.term = term;
    }

    /**
     * 
     * @param score
     */
    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DescriptorData other = (DescriptorData) obj;
        if ((this.conceptId == null) ? (other.conceptId != null) : !this.conceptId.equals(other.conceptId)) {
            return false;
        }
        if ((this.descriptorId == null) ? (other.descriptorId != null) : !this.descriptorId.equals(other.descriptorId)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 61 * hash + (this.conceptId != null ? this.conceptId.hashCode() : 0);
        hash = 61 * hash + (this.descriptorId != null ? this.descriptorId.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "DescriptorData{" + "conceptId=" + conceptId + ", descriptorId=" + descriptorId + ", category=" + category + ", term=" + term + ", score=" + score + '}';
    }

    @Override
    public int compareTo(DescriptorData o) {
        if (this.score > o.getScore()) {
            return -1;
        } else {
            return 1;
        }
    }
}
